Skip to content

docs: fix palette explorer export and frame the palettes page#629

Merged
johnleider merged 2 commits into
masterfrom
worktree-docs-palettes-export
Jul 18, 2026
Merged

docs: fix palette explorer export and frame the palettes page#629
johnleider merged 2 commits into
masterfrom
worktree-docs-palettes-export

Conversation

@johnleider

@johnleider johnleider commented Jul 17, 2026

Copy link
Copy Markdown
Member

Problem

The /guide/features/palettes page rated poorly for being confusing. Root causes, all in the interactive explorer at the top of the page:

  1. Copy Config emitted dead code. onExport produced a colors block where every line was commented out — pasting it gave a theme with no colors (silent no-op). The click path was worse: bare token strings with no role key, invalid once uncommented.
  2. No visible selection state. Clicking swatches quietly accumulated into the export, but nothing on screen showed what you'd picked, which role each mapped to, or how to reset — so idle exploring silently polluted the output.
  3. "Material" meant two things — the explorer's static entry vs the Material generator section lower down.
  4. Static-vs-generator and the {palette.…} token syntax were never framed before the widget.

Changes

Export

  • onExport now emits real, uncommented config. Clicked swatches map to theme roles (primary, secondary, …) in click order; the no-click default seeds primary/secondary from hues that actually exist in the selected palette (the old default hardcoded blue.500/slate.600, absent outside Tailwind).

Selection state

  • Summary chip row below the grid: each pick shows its swatch color, mapped role, and token path, with a per-chip remove and a Clear button.
  • Selected swatches get an inset outline so the grid and the export stay in sync.

Framing

  • Prose above the explorer: static vs generator forms, the token-reference syntax with a link to Theming, and a note that shade-heavy palettes (Material) render transposed.
  • In-widget hint explaining click-to-copy → Copy Config.
  • Static Material entry relabeled Material 3 to disambiguate from the generator section.

Verification

  • Export code-gen validated in isolation — no-click and multi-click branches both produce valid, resolvable config.
  • vue-tsc on apps/docs: 0 errors. ESLint clean. AppCloseButton confirmed auto-registered.
  • Not driven in a live browser — the docs dev server won't boot in this worktree (a build plugin's fs.watch hits ENOSPC on WSL, unrelated to this change). The interactive additions are straightforward reactive-Map bindings, but a click-through before merge is still worth doing.

The palette explorer's Copy Config button emitted a fully commented-out
colors block, so pasting its output produced a theme with no colors; the
click path emitted keyless token lines that were invalid once uncommented.

onExport now emits real, uncommented config: clicked swatches map to theme
roles in click order, and the no-click default seeds primary/secondary from
hues that actually exist in the selected palette so the reference resolves.

Adds framing prose above the explorer (static vs generator, token-reference
syntax, axis-flip note) and an in-widget hint explaining click-to-copy.
@johnleider johnleider added this to the v1.0.0 milestone Jul 17, 2026
@johnleider johnleider added the documentation Improvements or additions to documentation label Jul 17, 2026
@johnleider johnleider self-assigned this Jul 17, 2026
Clicking swatches now drives the export, but nothing showed what was
selected. Adds a summary chip row (swatch color, mapped role, token path)
with per-chip remove and a Clear button, plus a selected outline on each
picked swatch so the grid and the export stay in sync.

Relabels the static Material entry to 'Material 3' to disambiguate it from
the Material generator section further down the page.
@johnleider
johnleider marked this pull request as ready for review July 18, 2026 00:57
@johnleider
johnleider merged commit 70011cd into master Jul 18, 2026
20 checks passed
@johnleider
johnleider deleted the worktree-docs-palettes-export branch July 18, 2026 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant